package core;

import javax.swing.JFrame;

import gui.DatabaseConnectionWizard;
import gui.SchemaDiagramViewer;

public class ApplicationCore implements Runnable {

	private static JFrame wizard = new JFrame();
	private static JFrame viewer = new JFrame();
	
    public ApplicationCore() {	
    	configWizardGui();
    	configViewerGui();
    }
    
    private void configWizardGui() {
    	DatabaseConnectionWizard dcw = new DatabaseConnectionWizard();

    	wizard.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    	wizard.setName("DatabaseConnectionWizard");
    	wizard.setTitle("MMDSS - DB Connection Wizard");
    	wizard.setSize(330, 270);
    	wizard.setResizable(false); 
    	wizard.setLocationRelativeTo(null);   	
    	wizard.add(dcw);
    	wizard.setVisible(true);
    }
    
    private void configViewerGui() {
    	SchemaDiagramViewer sdv = new SchemaDiagramViewer();
    	
    	viewer.setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
    	viewer.setName("SchemaDiagramViewer");
    	viewer.setTitle("MMDSS - DB Schema Viewer");
    	viewer.setSize(800, 600);
    	viewer.setResizable(false); 
    	viewer.setLocationRelativeTo(null);
    	viewer.add(sdv);
    	viewer.setVisible(false);
    }
    
    public static JFrame getConnectionWizard() {
    	return wizard;
    }
    
    public static JFrame getSchemaViewer() {
    	return viewer;
    }

	@Override
	public void run() {
	}
}
